Given three integers L, R, and N, the task is to find the minimum possible value of (i * j) % N, where L ? i < j ? R....
A binary Tree is a hierarchical data structure in which each node has at most two children and it can referred to as the left child and right child. Due to being a non-linear data structure, different traversal techniques are possible for it....
In C++, modf() is a predefined function used for mathematical calculations. math.h is the header file required for various mathematical functions. All the functions available in this library take double as an argument and return double as the result. modf() function breaks the given argument into two parts, one is integer and the other one is fractional. Integer part is stored in the memory address pointed by the pointer which is passed as second argument in the function and the fractional part is returned by the function. Syntax:...
Given two arrays A[] and B[] each of size N, the task is to find the maximum sum that can be obtained based on the following conditions:...
In C, an array is a collection of elements of the same type stored in contiguous memory locations. This organization allows efficient access to elements using their index. Arrays can also be of different types depending upon the direction/dimension they can store the elements. It can be 1D, 2D, 3D, and more. We generally use only one-dimensional, two-dimensional, and three-dimensional arrays....
When adding more than 2 arrays, separate loops for adding elements step by step prove to give a better performance than adding the elements in a single loop....
In C, dynamic arrays are essential for handling data structures whose size changes dynamically during the program’s runtime. Strings are arrays of characters terminated by the null character ‘\0’. A dynamic array of strings will ensure to change it’s size dynamically during the runtime of the program as per the user’s needs. In this article, we will learn how to create a dynamic array of strings in C....
Given N stairs and a person standing at the bottom wants to reach the top. He could climb any number of steps from the given array arr[] of positive integers. The task is to find the count of all possible ways to reach the top....
Prerequisite : Inter Process Communication A message queue is a linked list of messages stored within the kernel and identified by a message queue identifier...
Functions can be invoked in two ways: Call by Value or Call by Reference. These two ways are generally differentiated by the type of values passed to them as parameters....
In C language, header files contain a set of predefined standard library functions. The .h is the extension of the header files in C and we request to use a header file in our program by including it with the C preprocessing directive “#include”....